<template>
  <div class="yangchenjiance_left-top">
    <checked-title title="数据统计"></checked-title>
    <div class="flex flex-between tip-group ">
      <div class="card">
        <div class="num">
          <span>{{ yangChenList.num }}</span
          >台
        </div>
        <div class="title">扬尘设备</div>
      </div>
      <div class="card">
        <div class="num">
          <span>{{ baoJingList.num }}</span
          >次
        </div>
        <div class="title mt15">报警次数</div>
        <div class="title mt-20">(近7天)</div>
      </div>
    </div>

    <div class="flex flex-between">
      <section class="card-list">
        <div>
          <span>交通路口</span>
          <span class="equipment">{{ yangChenList.jtNum }}</span>
          <span class="equipment">台</span>
        </div>
        <div>
          <span>建筑工地</span>
          <span class="early">{{ yangChenList.gdNum }}</span>
          <span class="early">台</span>
        </div>
        <div>
          <span>搅拌站</span>
          <span>{{ yangChenList.jbzNum }}</span>
          <span>台</span>
        </div>
      </section>
      <section class="card-list ">
        <div>
          <span>交通路口</span>
          <span class="colorCard">{{ baoJingList.jtNum }}</span>
          <span class="colorCard">次</span>
        </div>
        <div>
          <span>建筑工地</span>
          <span class="colorCard">{{ baoJingList.gdNum }}</span>
          <span class="colorCard">次</span>
        </div>
        <div>
          <span>搅拌站</span>
          <span class="colorCard">{{ baoJingList.jbzNum }}</span>
          <span class="colorCard">次</span>
        </div>
      </section>
    </div>
  </div>
</template>

<script>
import { YangChenJianCeDB } from '@/api'

export default {
  data() {
    return {
      yangChenList: {},
      baoJingList: {},
    }
  },
  created() {
    YangChenJianCeDB.DianWeiTongJi().then((res) => {
      this.yangChenList = res.data[0]
    })
    YangChenJianCeDB.BaoJingTongJi().then((res) => {
      this.baoJingList = res.data[0]
    })
  },
}
</script>

<style lang="less" scoped>
.yangchenjiance_left-top {
  width: 455px;
  margin: 0 auto;
}

.tip-group {
  color: #fff;
  margin-top: 30px;
}

.card {
  background: url(../../../assets/images/yangchenjiance/bg-tongji.png) no-repeat
    0 0;
  width: 201px;
  height: 99px;
  text-align: center;
  margin-bottom: 34px;

  &:last-child {
    background-position: right 0;

    .num {
      color: #ff2a3b;

      span {
        color: #ff2a3b;
      }
    }
    .mt-20 {
      margin-top: -0.5px;
      font-size: 12px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #ffffff;
    }
    .mt15 {
      margin-top: 0px;
    }
  }

  .num {
    font-size: 14px;
    font-weight: 400;
    color: #00faf0;

    span {
      color: #00faf0;
      font-weight: bold;
      font-size: 40px;
    }
  }

  .title {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    margin-top: 15px;
    font-family: Source Han Sans CN;
  }
}
.colorCard {
  color: #ff2a3b !important;
}
.card-list {
  > div {
    width: 200px;
    height: 50px;
    background: rgba(31, 73, 135, 0.25);
    border: 1px solid rgba(35, 104, 255, 0.25);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    padding-right: 30px;
    align-items: center;
    position: relative;
    margin-top: 13px;
    font-family: Noto Sans S Chinese;
    font-weight: 400;
    span:nth-child(1) {
      font-size: 14px;
      color: #ffffff;
      // margin-left: 30px;
      font-weight: 400;
      width: 60px;
      text-align: center;
    }

    span:nth-child(2) {
      color: #00faf0;
      // margin-left: 30px;
      font-weight: 400;
      font-family: Noto Sans S Chinese;
      font-size: 20px;
      width: 33px;
    }

    span:nth-child(3) {
      font-size: 14px;
      color: #00faf0;
      // margin-left: 7px;
      font-weight: 400;
    }

    &::before,
    &::after,
    span:nth-child(3)::before,
    span:nth-child(3)::after {
      content: '';
      display: block;
      position: absolute;
      width: 5px;
      height: 5px;
      background: #2368ff;
      opacity: 0.3;
    }

    &::before {
      left: -3px;
      top: -3px;
    }

    &::after {
      left: -3px;
      bottom: -3px;
    }

    span:nth-child(3)::before {
      right: -3px;
      top: -3px;
    }

    span:nth-child(3)::after {
      right: -3px;
      bottom: -3px;
    }
  }
}
</style>
